package com.bytz.modules.cms.domain.impl.price;

import com.bytz.modules.cms.domain.model.price.PriceComputeContext;
import com.bytz.modules.cms.domain.model.price.PriceComputeResult;
import org.springframework.stereotype.Component;

/**
 * 产品基准价计算器，顺序 1
 * @author shanxuezhong
 */
@Component
public class ProductBasePriceComputer extends AbstractPriceComputer {

    @Override
    public void doCompute(PriceComputeContext context) {
        for (PriceComputeResult value : context.getResults().values()) {
            // 基准价是传入的只需要赋值
            value.setPrice(value.getBasePrice());
        }
    }

    @Override
    public void afterCompute(PriceComputeContext context) {
        super.afterCompute(context);
    }
}
